const WebSocket = require('ws')

const ws = new WebSocket.Server({port:3000})

let count =0
ws.on('connection',(obj=>{
    obj.on('message',(msg)=>{
        console.log(JSON.parse(msg.toString()));
        obj.send('这是给你的，兄弟你拿着')

    })
            setInterval(()=>{
            count++
            obj.send(count)
        },2000)
}))
